package com.allen.study.test_common.utils.kafka;

import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Service;

/**
 * @ClassName: KafkaConsumerService
 * @Author: AllenSun
 * @Date: 2025/3/5 17:14
 */
@Service
@Slf4j
public class KafkaConsumerService {

    // @KafkaListener(topics = "my-topic", groupId = "my-group")
    public void listen(String message,Acknowledgment ack) {
        log.info("kafka消费者收到消息：" + message);
        // 消息消费完成
        ack.acknowledge();
    }
}




